﻿# -*- coding: utf-8 -*-
#import docx_write
import packXml
import pickle
import os
import sys
def getold():
	if os.path.exists("start.pickle"):
		old=open("start.pickle","rb").read()
		start=pickle.loads(old)
		if type(start) is dict:
			return start
		else:
			return {"start":1,"year":24}
	else:
		return None
def main():
	print(sys.path)
	print(sys.version)
	start_old=getold()
	start=start_old.get("start")
	print("上次打印到"+str(start_old)+"号,直接回车接着上次打印")
	year=input("开始年份：")
	start=input("开始号码：")
	try:
		start_old["year"]=int(year)
		start_old["start"]=int(start)
	except ValueError as e:
		pass
	print(start_old)
	input("here")
	packXml.getPeizhi(start_old,"横向收据模板.xml")#xml 2003 file
if __name__=="__main__":
    main()
    #testlink()